package quicksorttester;



/**
 * @author Zbyszko & atuan
 */
public class QuickSortTester {

    
    public static void main(String[] args) {
        
        /* Block: Settings */
        int maxStep = 10000;
        int maxInteger = 500;
        //int mode = 1; //0-milisec, 1-microsec, inne: nanosec
        /* Block-end: Settings */
          
        //long startTime;
        QuickSort quicksort = new QuickSort();
        Tests test = new Tests(maxInteger);
        //Counting comparisons
        //modes:
        //0 - random only
        //1 - optimistic
        //2 - pesimistic
        //3 - all
        test.performTest(3, quicksort, maxStep);
        //test.performTimeTests(3, quicksort, maxStep);
        
        
        /*for(int i=10; i<=maxStep; i+=10) {
            test = new Tests(i, maxInteger);
            System.out.println("Size of array: " + test.getNumbers().length);
            System.out.println("Unsorted elements: " + test.arrayToString());
            
            // randomly sorted elements
            startTime = test.initClock();
            quicksort.enableQuickSort(test.getNumbers()); 
            System.out.println("Time (random order): " + test.stopClock(mode, startTime));
            
            // properly sorted elements (optimistic scenario?)
            startTime = test.initClock();
            quicksort.enableQuickSort(test.getNumbers()); 
            System.out.println("Time (optimistic): " + test.stopClock(mode, startTime));
            
            // reversly sorted elements (pesimistic scenario?)
            test.reverseOrder(test.getNumbers());
            //System.out.println("Reverse: "+test.arrayToString());
            startTime = test.initClock();           
            quicksort.enableQuickSort(test.getNumbers()); 
            System.out.println("Time (pesimistic): " + test.stopClock(2, startTime));
            
            
            // Final array
            System.out.println("Sorted elements: " + test.arrayToString()+"\n");
            
        }*/
     
    }
}
